home *** CD-ROM | disk | FTP | other *** search
- /* tan.c from page 249*/
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #define R_TO_D 57.29578 /*radians to degrees */
- main(int argc, char **argv)
- {
- double result;
- if(argc < 2)
- {
- printf("usage: %s <degree>\n", argv[0]);
-
- }
- else
- {
- result = tan(atof(argv[1]) / R_TO_D);
- if(errno != ERANGE)
- {
- printf("tangent(%s deg.) = %f\n",
- argv[1], result);
- }
- }
- }